<template>
  <div class="contenttext">
    <van-nav-bar title="评价详情" left-arrow @click-left="onClickLeft" />
    <div class="pi">
      <div class="header">
        <img :src="content.img" alt="" />
        <span>{{ content.goodsname }}</span>
      </div>
      <div class="content">
        <div class="top">
          评价:<van-rate
            v-model="content.rate"
            :size="25"
            color="#ffd21e"
            void-icon="star"
            void-color="#eee"
            readonly 
          />
        </div>
        <div class="text">{{content.content}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "contenttext",
  data() {
    return {
      content: {},
    };
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
  },
  created() {
    console.log(this.$route.query);
    axios({
      method: "get",
      url: "/comments",
      params: { id: this.$route.query.ids },
    }).then((res) => {
      this.content = res.data[0];
    });
  },
};
</script>
<style  scoped>
.pi {
  padding: 0rem 0.1rem;
}
.header {
  height: 0.65rem;
  background-color: #fff;
  border-radius: 0.12rem;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0rem 0.1rem;
}
.header img {
  height: 0.5rem;
  width: 0.5rem;
}
.header span {
  font-size: 0.18rem;
  flex-wrap: 500;
}
.content {
  margin-top: 0.1rem;
  height: 1rem;
  background-color: #fff;
  border-radius: 0.12rem;
  padding: .15rem .1rem;
  font-size: .16rem;
}
.content .text {
    margin-top: .2rem;
    font-weight: 600;
}
</style>


